package com.sky.controller.user;

import com.sky.constant.JwtClaimsConstant;
import com.sky.dto.UserLoginDTO;
import com.sky.entity.User;
import com.sky.result.Result;
import com.sky.service.WorkSpaceService;
import com.sky.utils.JwtUtil;
import com.sky.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin/workspace")
@Api(tags = "工作台相关接口")
@Slf4j
public class WorkSpaceController {
    @Autowired
    private WorkSpaceService workSpaceService;

    /*
     * 查询今日运营数据
     * */
    @GetMapping("/businessData")
    @ApiOperation("查询今日运营数据")
    public Result<BusinessDataVO> getData() {
        BusinessDataVO businessDataVO = workSpaceService.getData();
        return Result.success(businessDataVO);
    }

    /*
     * 查询套餐总览
     * */
    @GetMapping("/overviewSetmeals")
    @ApiOperation("查询套餐总览")
    public Result<SetmealOverViewVO> getOverviewSetmeal() {
        SetmealOverViewVO setmealOverviewVO = workSpaceService.getOverviewSetmeal();
        return Result.success(setmealOverviewVO);
    }
    /*
    * 查询菜品总览
    * */
    @GetMapping("/overviewDishes")
    @ApiOperation("查询套餐总览")
    public Result<DishOverViewVO> getOverviewDish() {
        DishOverViewVO dishOverViewVO = workSpaceService.getOverviewDish();
        return Result.success(dishOverViewVO);
    }
    /*
    * 查询订单数据接口
    * */
    @GetMapping("/overviewOrders")
    @ApiOperation("查询订单数据接口")
    public Result<OrderOverViewVO> getOrderCount() {
        OrderOverViewVO orderCount = workSpaceService.getOrderCount();
        return Result.success(orderCount);
    }
}
